﻿using FluentValidation;
using Nop.Admin.Models.Directory;
using Nop.Core.Domain.Directory;
using Nop.Data;
using Nop.Services.Localization;
using Nop.Web.Framework.Validators;

namespace Nop.Admin.Validators.Directory
{
    public partial class OrganizationValidator : BaseNopValidator<OrganizationModel>
    {
        public OrganizationValidator(ILocalizationService localizationService, IDbContext dbContext)
        {
            RuleFor(x => x.Name).NotEmpty().WithMessage("单位名称不能为空");

            SetDatabaseValidationRules<Organization>(dbContext);
        }
    }
}